package com.qf.feign;

import com.baomidou.mybatisplus.plugins.Page;
import com.qf.common.result.ResultEntity;
import com.qf.entity.User;
import com.qf.fallBack.UserFeignFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "shop-user", fallback = UserFeignFallBack.class)
public interface UserFeignService {
    @RequestMapping("/userController/addUser")
        //从前端传过来的是json数据 要用这个注解接受
    ResultEntity addUser(@RequestBody User user);

    @RequestMapping("/userController/getUser")
    Page<User> getUserPage(@RequestBody Page<User> page);

    @RequestMapping("/userController/getUserByUsername")
    User getUserByUsername(@RequestParam String username);
}
